package com.wen.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wen.pojo.ProductType;
import com.wen.pojo.dto.ProductAndProductType;

import com.wen.pojo.dto.ProductDto;
import com.wen.pojo.dto.ProductTypeDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ProductTypeMapper  extends BaseMapper<ProductType> {

    /**
     *分类导航栏
     * @return
     */
    @Select("SELECT * FROM `product` p INNER JOIN `product_type` pt WHERE p.`type_id` = pt.`type_id`")
    Page<ProductAndProductType> selectProductORProductType(Page page, @Param("product") QueryWrapper<ProductAndProductType> dto);



    Page<ProductAndProductType> selectAdvance(Page page, @Param("product") ProductDto dto);


    Page<ProductType> selectProductType(Page page, @Param("productType") ProductTypeDto dto);


}
